// PlacedObject.h provides the attributes of the PlacedObject class
//-----------------

#if !defined( PlacedObjectH)
#define PlacedObjectH

//-----------------
// Includes various libraries and files
#include <cassert>		// for asserts
#include <d3dx9.h>		// Direct 3D library (for all Direct 3D functions)
#include <sstream>
#include <string>

#include "Mesh.h"
#include "ModelAsset.h"
//-----------------

class PlacedObject {
	public:
		// constructors and destructor
		PlacedObject();
		PlacedObject( const PlacedObject& object);
		PlacedObject( const ModelAsset& model);
		~PlacedObject();

		// accessors
		float get_x() const;
		float get_y() const;
		float get_z() const;
		float get_true_x() const;
		float get_true_y() const;
		float get_true_z() const;
		float get_x_dimension() const;
		float get_y_dimension() const;
		float get_z_dimension() const;

		std::string get_file_name() const;
		std::string get_object_name() const;
		int get_object_type() const;
		int get_rotation() const;
		bool get_breakable() const;
		int get_max_health() const;

		void render() const;

		std::string information() const;

		// mutators
		void set_mesh( Mesh* mesh);
		void set_object_name( const std::string& name);
		void set_object_type( const int& t);
		void set_position( const float& x, const float& y, const float& z);
		void set_dimensions( const float& x, const float& y, const float& z);
		void set_rotation( const int& r);
		void set_breakable( const bool& b);
		void set_max_health( const int& h);
		void rotate_clockwise();
		void rotate_anticlockwise();	// currently not used - other mouse button rotates the floor on the grid block

		// overloaded operator
		PlacedObject& operator =( const ModelAsset& a);
		friend std::ostream& operator <<( std::ostream& os, const PlacedObject& p);
	private:
		Mesh* mesh_;
		D3DXVECTOR3 position_;
		D3DXVECTOR3 dimensions_;
		int rotation_;
		bool breakable_;
		int max_health_;

		std::string file_name_;
		std::string object_name_;
		int object_type_;
};

#endif